feat(platform): add SDL windowing provider and Switch Vulkan feasibility PoC - #661
Merged
Merged
Conversation
…ity PoC Implement two new platform backends following the Xbox GDK PoC pattern: SDL2 windowing (#337): - Feature flag: `--features sdl-window` with sdl2 0.37 (bundled + raw-window-handle) - Real SDL2 initialization with window creation, event pump, and input mapping - SdlWindowHandle extracts raw handles via SDL2's raw-window-handle 0.6 support - wgpu Vulkan init path via WgpuBackend::new_from_sdl_handle() - Full PlatformBackend implementation with keyboard, mouse, scroll, fullscreen Nintendo Switch Vulkan (#341): - Feature flag: `--features switch-vulkan` - Stub SwitchVulkanPlatform (no SDK available, returns BackendNotSupported) - SwitchWindowHandle with dummy raw-window-handle implementation - wgpu Vulkan init path via WgpuBackend::new_from_switch_handle() - Feasibility report at docs/findings/switch-vulkan-poc.md Both backends integrate into native_runtime.rs (detection, validation, construction) and extend WindowBackendKind (SdlWindow=3, SwitchVulkan=4). Closes #337, Closes #341 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d cfg gates The Wgpu enum variant and all its match arms in native_backend/mod.rs were missing the sdl-window and switch-vulkan features, which would cause compilation failures when those features are enabled standalone. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Claude finished @aram-devdocs's task in 2m 44s —— View job PR Review: feat(platform): add SDL windowing provider and Switch Vulkan feasibility PoCTodo List
Verdict: ✅ APPROVED (with warnings)The implementation is well-structured, follows the existing Xbox GDK pattern exactly, is properly feature-gated, all BLOCKERSNone. WARNINGS (should fix, non-blocking)
Positive Observations
Detail: The Duplication Problem (W1)
Both already duplicate |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sdl2 0.37's bundled SDL2 build fails on CI runners with newer CMake versions that dropped compatibility with cmake_minimum_required < 3.5. sdl2 0.38 ships a newer SDL2 source that works with modern CMake. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sdl2-sys bundles SDL2 source with cmake_minimum_required(VERSION 3.1.3). CMake 4.0+ on CI runners removed compatibility with policies < 3.5. Setting CMAKE_POLICY_VERSION_MINIMUM=3.5 restores it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aram-devdocs
added a commit
that referenced
this pull request
Apr 3, 2026
Incorporate PR #661 (SDL windowing/Switch PoC) changes. No conflicts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aram-devdocs
added a commit
that referenced
this pull request
Apr 3, 2026
Apply the same vsync parameter pattern to new_from_sdl_handle() and new_from_switch_handle() introduced by PR #661, ensuring vsync config is respected across all platform backends. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Type: feature
Summary: Add two new platform backends following the Xbox GDK PoC pattern: an SDL2-based windowing provider with real window creation and input mapping, and a Nintendo Switch Vulkan feasibility stub with a comprehensive findings report.
Related Issues: Closes #337, Closes #341
Changes Made
Engine Core (
goud_engine/src/)sdl-windowandswitch-vulkanfeature flags to Cargo.tomlWindowBackendKindenum withSdlWindow = 3andSwitchVulkan = 4variantsPlatformBackendtrait cfg gates to include new featuresSdlPlatformimplementingPlatformBackendwith real SDL2 window creation, event pump, keyboard/mouse/scroll input mapping via scancode-to-KeyCode tableSwitchVulkanPlatformstub (always returnsBackendNotSupported)SdlWindowHandleusing SDL2's raw-window-handle 0.6 support for wgpu surface creationSwitchWindowHandlestub (always returnsHandleError::Unavailable)WgpuBackend::new_from_sdl_handle()andnew_from_switch_handle()detect_best_backend(),validate_native_backend_pair(), andcreate_native_runtime()for both new pairsNativeRenderBackend::Wgpucfg gates innative_backend/mod.rsto include new featuresFFI Layer (
goud_engine/src/ffi/)No changes
C# SDK (
sdks/csharp/)No changes
Python SDK (
sdks/python/)No changes
TypeScript SDK (
sdks/typescript/)No changes
Codegen Pipeline (
codegen/)No changes
Proc Macros (
goud_engine_macros/)No changes
Tools (
tools/)No changes
WASM (
goud_engine/src/wasm/)No changes
Examples (
examples/)No changes
Documentation
docs/findings/switch-vulkan-poc.md— comprehensive feasibility report covering wgpu Vulkan compatibility, 7 blocking issues, audio/input/filesystem gaps, build toolchain requirements, and 12-18 week estimated effortArchitectural Compliance
unsafeblocks have// SAFETY:commentsTesting
cargo testpasses (4740 passed, 0 failed, 28 ignored)cargo clippy -- -D warningsis cleancargo clippy --features sdl-window -- -D warningsis cleancargo clippy --features switch-vulkan -- -D warningsis cleancargo fmt --all -- --checkpassescargo check --features sdl-windowpassescargo check --features switch-vulkanpassescargo check(default features) passesCode Quality
todo!()orunimplemented!()in production code#[allow(unused)]without justification commentResult, notunwrap()/expect()in library codeDocumentation
Breaking Changes
None
Version Bump
Bump type: none
Justification: Feature-gated PoC modules, no public API changes
Security
unsafe impl Send/Syncblocks have// SAFETY:comments and are necessaryPerformance
N/A — feature-gated PoC modules behind opt-in flags, no impact on default build path.
Deployment
Reviewer Notes
sdl2crate withbundledfeature compiles SDL2 from source. Auto-detection prefers SDL only on Linux; manual selection works on all desktops.sdl_init.rs,switch_init.rs) duplicate the wgpu initialization boilerplate fromxbox_init.rs. A shared helper should be extracted before promoting any PoC to production.SwitchWindowHandle'sunsafe impl Send + Syncon*mut c_voidis flagged for mandatory re-audit when NintendoSDK integration begins.